<div class="editcate_top">
		    <h2><?php echo $this->lang->line('edit'); ?>:</h2>
		    <a href = "javascript:void(0)" onclick ="$('#light_adct').hide();$('#fade_adct').hide()"><img src="<?php echo base_url();?>public/admin/img/close.png" class="png" /></a>
</div>

<div id="div_message"></div>
		<form action="<?php echo  admin_url();?>/edit-video/<?php echo $info->id; ?>" method="post" id="edit-video-form" enctype="multipart/form-data">
			<div class="article_ct">
				<div class="btarticle">
			        <input type="submit" value="<?php echo $this->lang->line('save'); ?>" class="btn edit-video" />
		    	</div>
				<ul class="metatags">
			    	<li>
			        	<span class="left"><b><?php echo $this->lang->line('name'); ?>* : </b></span>
			            <span class="right"><input type="text" name="name" value="<?php echo $info->name;?>" style="width:100%;" id="add-name-page" /></span>
			        </li>
			        <li>
		        		<span class="left"><b><?php echo $this->lang->line('thumbnail');?> :</b></span>
		        		<input type="hidden" id="image" name="image" value=""/>
		                <span class="right">
		                	<input type="button" value="<?php echo $this->lang->line('select_thumb');?>" onclick="window.open('<?php echo admin_url('video/image/position/vid/dir/videos');?>', '_blank', 'width=800,height=600,scrollbars=yes,status=yes,resizable=yes,screenx=0,screeny=0');" class="button" style="float:left; width: 110px;padding: 5px 0;cursor:pointer;" />
		                </span>        		
			        </li>
			        <li>
			               <span class="left">&nbsp;</span>
			               <span class="right"><img id="image_thumb" src="<?php echo (file_exists($info->image_url))?base_url().$info->image_url:base_url()."public/admin/img/no_image.gif";?>" width="120px" height="90px"/></span> 		
			        </li>
			        <li>
			        	<span class="left"><b><?php echo $this->lang->line('video'); ?>* :</b><i style="font-size: 10px; color:green;">(<?php echo $this->lang->line('required'); ?>: flv, mp4, avi & <?php echo $this->lang->line('size'); ?> 50MB)</i></span>
			            <span class="right"><input type="text" onfocus="if (this.value == 'Video Url') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Video Url';}" name="video_url" value="<?php echo ($info->video_url)?$info->video_url:"Video Url";  ?>" style="width:100%;font-style: italic;color: brown;" /></span>
			            <span class="right"><input type="file" name="video_file"  value="" style="width: 100%;"/></span>
			        </li>
			        <li>
			        	<span class="left"><b>Demo:</b></span>
			        	<span class="right">
			            	<embed
								 type="application/x-shockwave-flash" 
								 id='MediaPlayer'
								 name='MediaPlayer'
								 quality="high" 
								 src='<?php echo base_url();?>/jwplayer/player.swf'
								 width='320'
								 height='240'
								 allowscriptaccess='always'
								 allowfullscreen='true'
								 flashvars='file=<?php if(file_exists($info->video)){echo base_url().$info->video;}else{echo $info->video_url;}?>'
								/> 
			            </span>
						
			        </li>
		            <li>
			        	<span class="left"><b><?php echo $this->lang->line('description'); ?> : </b></span>
			            <span class="right"><textarea name="description" id="edit-des-video" style="width: 100%; height: 100px;"><?php echo $info->description;?></textarea></span>
			        </li>
		            <li>
		                <span class="left"><b><?php echo $this->lang->line('order'); ?>* : </b></span>
		                <span class="right">
		                	<select name="order" class="edit-order" style="width: 150px;">
		                		<?php for($i=1; $i<=20; $i++){?>
		                		<option value="<?php echo $i;?>" <?php echo ($i == $info->order)?"selected":""; ?> ><?php echo $i;?></option>
		                		<?php }?>
		                	</select>
		                </span>
		            </li>
		            <li>
		                <span class="left"><b><?php echo $this->lang->line('status'); ?>* : </b></span>
		                <span class="right">
		                	<select name="status" class="add-status" style="width: 150px;">
		                		<option value="yes" selected="selected"><?php echo $this->lang->line('active'); ?></option>
		                		<option value="no"><?php echo $this->lang->line('suspend'); ?></option>
		                	</select>
		                </span>
		            </li>
			    </ul>
			    <div id="old_video">
			    	<input type="hidden" name="old_video" value="<?php echo $info->video;?>" />
			    </div>
			    <div class="btarticle">
			    	<input type="button" value="<?php echo $this->lang->line('cancel'); ?>" class="btn" onclick="reback()" />
			        <input type="submit" value="<?php echo $this->lang->line('save'); ?>" class="btn add-new-page" />
		    	</div>
			</div>
		</form>
<script type="text/javascript">
$('#edit-video-form').iframer({
    onComplete: function(msg){
    	if(msg == 'yes') {
    		$('#light_adct').hide();$('#fade_adct').hide();
    		alert('<?php echo $this->lang->line('edit_mess'); ?>');
            window.location	=	admin_url+'video';
    	}
    	else show_error('div_message', msg)
    }
});

function reback(){
	$('#light_adct').hide();$('#fade_adct').hide();
	window.location = admin_url+'video';
}

var ADMIN_IMAGE_INPUT_TEXT = '0';
$(function (){

	if($('#image').val() == "") {
        $('#image_thumb').attr('src', '<?php echo (file_exists($info->image_url))?base_url().$info->image_url:base_url()."public/admin/img/no_image.gif";?>');
    }
});
</script>